/*
 * File:   eap.h
 * Author: plroit
 *
 * Created on May 24, 2009, 11:00 AM
 *
 * Header file for TLS using EAP extension
 * Defines Data Structs to handle EAP message payload
 * and library functions
 */

#ifndef _EAP_H
#define	_EAP_H

#include <openssl/buffer.h>

#define EAP_HEADER_LENGTH       4
#define EAP_DATA_TYPE_LENGTH    1
#define EAP_FULL_HEADER_LENGTH  (EAP_HEADER_LENGTH + EAP_DATA_TYPE_LENGTH)
#define EAP_HS_HEADER_LENGTH    4
#define EAP_MSG_OFFSET          (EAP_HS_HEADER_LENGTH + EAP_FULL_HEADER_LENGTH)
#define EAP_IDENTITY_REQ_MSG    "Please enter your username:\n"
#define EAP_METHOD_LIBRARY_DIR  "/usr/local/lib/eap"
#define EAP_IDENTITY_SIZE       1015
#define IS_EAP(s) (s && s->tlsext_eap && s->tlsext_eap_confirmed)

    int EAP_finalize_eap_message(SSL *s, 
                                const unsigned char *eap_msg,
                                const unsigned int eap_msg_len);

#ifdef	__cplusplus
}
#endif

#endif	/* _EAP_H */

